package com.example.photography.util;

import android.os.Environment;
import android.util.Log;

import java.io.File;

/**
 * 删除文件
 */
public class Comm {
    public static File getPathFile(String path){
        String apkName = path.substring(path.lastIndexOf("/"));
        File outputFile = new File(Environment.getExternalStoragePublicDirectory
                (Environment.DIRECTORY_DOWNLOADS), apkName);
        return outputFile;
    }

    public static void removeFile(String path){
        File file = getPathFile(path);
        if (file!=null){
            file.delete();
        }else {
            Log.e("------------------","file为空");
        }

    }

}
